using System;
using Microsoft.Win32;

namespace Publish.Services
{
    /// <summary>
    /// 桌面路径地址
    /// </summary>
    public class DesktopPathService
    {
        private const string RegeditPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders";//注册表路径
        
        /// <summary>
        /// 通过注册表获取桌面路径（用户很有可能修改过注册表，比如说我）
        /// </summary>
        /// <returns></returns>
        public String GetDesktopPath()
        {
            return Registry.CurrentUser.OpenSubKey(RegeditPath, true).GetValue("Desktop") + "/";
        }
    }
}
